﻿<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/commons/include.jsp" %>
<html>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<head>
<base href="<%=basePath%>">
    <title>发送短信</title>  
    <link rel="stylesheet" type="text/css" media="all" href="<%=path%>/js/calendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />
    <script type="text/javascript" src="<%=path%>/js/calendar/calendar.js"></script>
	<script type="text/javascript" src="<%=path%>/js/calendar/calendar-setup.js"></script>
	<script type="text/javascript" src="<%=path%>/js/calendar/calendar-zh1.js"></script>  
	<link href="<%=path%>/template/css.css" rel="stylesheet" type="text/css">
	<link href="css/style.css" rel="stylesheet" type="text/css">
	<style type="">
		div#content {
        position: relative;
        width: 500;
        
        margin: 0 auto 20px auto;
        padding: 0;
        
        text-align: left;
    }
	</style>
	</head>

<body>
<table width='200' border='0' cellspacing='0' cellpadding='0'>
			<tr>
				<td width='90'><img src='images/loc-head.jpg' width='90' height='24'></td>
				<td valign='middle' nowrap background='images/loc-bg.jpg' class="title">EXCEL短信发送</td>
				<td width='12'><img src='images/loc-tail.jpg' width='12' height='24'></td>
			</tr>
		</table><br>
<s:fielderror />
<s:form action="sendexcelsms.action" name="inputform" enctype="multipart/form-data" cssStyle="iptform" cssClass="myform">
<table border="0" width="100%" class="ipttable">
	<tr height="100%">
		<td width="100%" align="left">
		<table>
		<tr>
		<td class="iptform">EXCEL文件：</td>
		<td><input type='file' name="mobilefile" style="width:350px;" class="input130"/></td>
		</tr>
		<tr>
		<td class="iptform">短信标题：</td>
		<td><input class="inputNormal" type="text" name="title" value="在此输入短信标题" style="width:285px;" onfocus="if(this.value=='在此输入短信标题'){this.value=''}" onblur="if(this.value==''){this.value='在此输入短信标题'}"></td>
		</tr>
		<tr>
		<td class="iptform">短信内容：</td>
		<td width="455">
		<textarea  id="content" class="textarea" name="content" rows="10" cols="80"></textarea>
		<input onclick="openSelNormalInfo()" type="button" value="常用短信" class="selectbtn" />
		</td>
		</tr>
		<tr>
		<td></td>
		<td></td>
		</tr>
		<tr>
		<td class="iptform">定时发送：</td>
		<td><input id="smstime" readonly name="smstime" onclick="" class="inputNormal"></td>
		</tr>
		</table>		
		</td>
	</tr>
	<tr><td align="center">
			  <input type="button" onclick="document.all.inputform.submit()"  value="提交"  class="submitbtn">
			  &nbsp;&nbsp;&nbsp;&nbsp;
			  <input type="reset" value="重置" class="selectbtn">
			      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			      </td></tr>
</table>
</s:form>
    <script type="text/javascript">
    	function openform(){
    		var title = ""; 
		var url = 'userSel.jsp';
		var pageUrl="userSel.jsp";
		var paraObj = new Object();
		paraObj.url=url;
		paraObj.title=title;
		var obj=document.getElementById('toPersons');
		paraObj.input=obj;
		var sFeatures = 'help:no;status:1;dialogHeight:500px;dialogWidth:350px;center:1';
	    var rtnObj= window.showModalDialog(pageUrl,paraObj,sFeatures );
	    //alert('rtnObj='+rtnObj);
		if(rtnObj){
			var result=rtnObj.result;
			obj.value=result;
		}else{
    		
    	}
    	//alert('openform');
    	}
    	
    	function openSelNormalInfo(){
    		var title = ""; 
		var url = 'selnormalsmsList.action';
		var pageUrl="selnormalsmsList.action";
		var paraObj = new Object();
		paraObj.url=url;
		paraObj.title=title;
		var obj=document.getElementById('content');
		paraObj.input=obj;
		var sFeatures = 'help:no;status:1;dialogHeight:500px;dialogWidth:350px;center:1';
	    var rtnObj= window.showModalDialog(pageUrl,paraObj,sFeatures );
	    //alert('rtnObj='+rtnObj);
		if(rtnObj){
			var result=rtnObj.result;
			obj.value=result;
		}else{
    		
    	}
    	}
    	
    	Calendar.setup(
		    {
		      inputField  : 'smstime',         // ID of the input field
		      ifFormat    : "%Y-%m-%d %H:%M:%S",    // the date format
		      onSelect   : onSelect,
		      showsTime : true
		    }
		  );
		 
function onSelect(calendar, date) {
    if (!IsDateBeforeToday(date)) {
    	var curEdt = document.getElementById(calendar.params.inputField.id);
      	curEdt.value = date;
      
    } else {
    	//alert();
    	window.status='所选日期不能小于今日!';
    }
	};

	 function IsDateBeforeToday(sDate) {
	   var ss = sDate.split('-'); 
	 var s = ss[1]+'-'+ss[2]+'-'+ss[0]; //形成月-日-年的格式,准备给Date.parse去解析
	 var d1 = new Date();
	 var d2 = Date.parse(s);
	 return d1 >= d2 ;
	 }
	 document.onclick=function(){
	 	if(parent){
	 		try{parent.clearMenu();}catch(e){}
	 	}
	 }
    </script>
</body>
</html>